package kosta.model;

import java.sql.SQLException;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
@Service
public class MemberServiceImpl implements MemberService{
	@Resource(name="studentOfMemberDaoImpl")
	private MemberDao StudentOfmemberDao;	
	@Resource(name="teacherOfMemberDaoImpl")
	private MemberDao TeacherOfmemberDao;
	
	
	@Override
	public void registerMember(MemberVO mvo) throws SQLException {
		MemberVO tmvo=null;
		System.out.println(mvo+"3");
		if(mvo.getMembertype().equals("s")){
			System.out.println("이게나오면 안됨");
			StudentOfmemberDao.registerMember(mvo);	
		}else if(mvo.getMembertype().equals("t")){		
			System.out.println(mvo+"service 두번째");
			TeacherOfmemberDao.registerMember(mvo);			
		}
		
	}
	@Override
	public MemberVO showMember(MemberVO mvo) throws SQLException {
		MemberVO rmvo=null;
		if(mvo.getMembertype().equals("s")){
			rmvo=StudentOfmemberDao.showMember(mvo);
		}else if(mvo.getMembertype().equals("t")){
			rmvo=TeacherOfmemberDao.showMember(mvo);
		}
		
		return rmvo;
	}
}
